<div class="row">
            <div class="col-md-6">
               
               <!--#region grupos -->
                <section class="widget">
                    <header>
                        <h4>
                            <i class="fa fa-globe"></i>
                            Mis  
                            <small>
                                Invitaciones
                            </small>
                        </h4>
                    </header>
                    <div class="body text-align-center" >
			
                        <div>
                            <!-- Grupos -->
                            <?php
                            if(isset($notifications))
                            {
                              if(count($notifications) > 0)
			      {
                            ?>
                            <table class="table table-striped" id="tableGeneral">
                              <thead>
                              <tr>
                                  <th style="text-align: center; width: 70%;"><strong>Grupo</strong></th>
				  <th style="text-align: center;"><strong></strong></th>
				  <th style="text-align: center; width: 40px; text-align: center;"><strong></strong></th>
				  <th style="text-align: center; width: 40px; text-align: center;"><strong></strong></th>
				  <th></th>
                              </tr>
                              </thead>
                              <tbody>
                              <?php
			      
                              foreach($notifications as $n)
                              {
                                    echo '<tr>';
                                    echo '<td style="text-align: left">'.$n['gpoName'].'</td>';
                                    switch($n['status'])
				    {
						case "PN":
							    echo "<td><span class=\"label label-warning\" title=\"Pendiente\">PN</span></td>";
							    echo "<td><i class=\"fa fa-thumbs-o-up\" style=\"cursor:pointer; color: #56bc76;\" onClick=\"AceptarP(1,'".$n['idInvit']."')\"></td>";
							    echo "<td><i class=\"fa fa-thumbs-o-down\" style=\"cursor:pointer; color: #e5603b;\" onClick=\"AceptarP(0,'".$n['idInvit']."')\"></td>";
							    break;
						
						case "AC":
							    echo "<td><span class=\"label label-success\" title=\"Aceptada\">AC</span></td>";
							    echo "<td><i class=\"fa fa-minus\"></td>";
							    echo "<td><i class=\"fa fa-minus\"></td>";
							    break;
						
						case "RE":
							    echo "<td><span class=\"label label-default \" title=\"Rechazada\">RE</span></td>";
							    echo "<td><i class=\"fa fa-minus\"></td>";
							    echo "<td><i class=\"fa fa-minus\"></td>";
							    break;
						
						case "CO":
							    echo "<td><span class=\"label label-danger \" title=\"Grupo Completo\">CO</span></td>";
							    echo "<td><i class=\"fa fa-minus\"></td>";
							    echo "<td><i class=\"fa fa-minus\"></td>";
							    break;
				    }
				    
                                    echo '</tr>';
                              }
                              ?>
                              </tbody>
                            </table>
                            
                            <?php
			      }
			      else
			      {
				    echo '
						<div class="alert alert-error">
						    No tienes invitaciones por el momento.
						</div>
						';
			      }
                            }
                            else
                            {
                              echo '
                                  <div class="alert alert-error">
                                      No tienes invitaciones por el momento.
                                  </div>
                                  ';
                            }
                            ?>
                          <!-- -->  
                        </div>
                    </div>
                </section>
		
            </div>
            
</div>
<script>
function AceptarP(confirm, idInv) {
	    //alert(item + " - " +  id);
	    var data_ajax={
	    type: 'POST',
	    url: "<?php echo base_url(); ?>user/set_user_invitation",
	    data: { id: idInv, action: confirm },
	    success: function( data ) {
		    if (data == true) {
			RecargarPage();
		    }
		},
	    error: function(){
		    alert("error");
		},
	    dataType: 'json'
	    };
	    $.ajax(data_ajax);
}

function RecargarPage()
{
	    var data_ajax={
                    type: 'POST',
                    url: "<?php echo base_url(); ?>user/invitations",
                    data: { },
                    success: function( data ) {
                                                $("#content_container").html(data);
                                              },
                    error: function(data){$("#content_container").html(data);},
                    dataType: 'json'
                    };
            $.ajax(data_ajax);
}
</script>